package io.jenkins.plugins.feiqiu;

import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import org.kohsuke.stapler.DataBoundConstructor;

public class FeiqiuTarget extends AbstractDescribableImpl<FeiqiuTarget> {

  //目标ip
  private String ip;
  private Integer port;
  private Boolean groupMsg;
  private Long groupId;

  private Boolean sendRange;
  private String rangeIp;
  private Integer ipStart;
  private Integer ipEnd;

  @Extension
  public static class DescriptorImpl extends Descriptor<FeiqiuTarget> {

    public String getDisplayName() {
      return "FeiqiuTarget";
    }
  }

  @DataBoundConstructor
  public FeiqiuTarget(Integer port, Boolean groupMsg, Long groupId,
      String rangeIp, Integer ipStart, Integer ipEnd) {
//    this.ip = ip;
    this.port = port;
    this.groupMsg = groupMsg;
    this.groupId = groupId;
//    this.sendRange = sendRange;
    this.ipStart = ipStart;
    this.ipEnd = ipEnd;
    this.rangeIp = rangeIp;
  }

  public Boolean getSendRange() {
    return sendRange;
  }

  public void setSendRange(Boolean sendRange) {
    this.sendRange = sendRange;
  }

  public String getRangeIp() {
    return rangeIp;
  }

  public void setRangeIp(String rangeIp) {
    this.rangeIp = rangeIp;
  }

  public Integer getIpStart() {
    return ipStart;
  }

  public void setIpStart(Integer ipStart) {
    this.ipStart = ipStart;
  }

  public Integer getIpEnd() {
    return ipEnd;
  }

  public void setIpEnd(Integer ipEnd) {
    this.ipEnd = ipEnd;
  }

  public String getIp() {
    return ip;
  }

  public void setIp(String ip) {
    this.ip = ip;
  }

  public Integer getPort() {
    return port;
  }

  public void setPort(Integer port) {
    this.port = port;
  }

  public Boolean getGroupMsg() {
    return groupMsg;
  }

  public void setGroupMsg(Boolean groupMsg) {
    this.groupMsg = groupMsg;
  }

  public Long getGroupId() {
    return groupId;
  }

  public void setGroupId(Long groupId) {
    this.groupId = groupId;
  }

  @Override
  public String toString() {
    return "FeiqiuTarget{" +
        "ip='" + ip + '\'' +
        ", port=" + port +
        ", groupMsg=" + groupMsg +
        ", groupId=" + groupId +
        '}';
  }
}
